﻿using BCCommon.Enums;
using BCEntity.Common.PushMessageConfig;
using System;
using System.Collections.Generic;
using System.Threading.Tasks;

namespace BCData.Common.PushMessageConfig
{
    /// <summary>
    /// 推送信息设置
    /// </summary>
    public interface IPushMessageConfigData
    {
        /// <summary>
        /// 检查推送消息配置是否存在
        /// </summary>
        /// <param name="pushMessageType">推送消息类型</param>
        /// <returns></returns>
        Task<object> CheckPushMessageConfigExists(PushMessageType pushMessageType);

        /// <summary>
        /// 检查推送消息配置是否存在
        /// </summary>
        /// <param name="pushMessageConfigId">推送消息配置Id</param>
        /// <param name="pushMessageType">推送消息类型</param>
        /// <returns></returns>
        Task<object> CheckPushMessageConfigExists(int pushMessageConfigId, PushMessageType pushMessageType);

        /// <summary>
        /// 检查推送消息配置是否存在
        /// </summary>
        /// <param name="pushMessageConfigId">推送消息配置Id</param>
        /// <returns></returns>
        Task<object> CheckPushMessageConfigExists(int pushMessageConfigId);

        /// <summary>
        /// 获取推送消息配置
        /// </summary>
        /// <param name="pushMessageType">推送消息类型</param>
        /// <returns></returns>
        Task<PushMessageConfigEntity> GetEntity(PushMessageType pushMessageType);

        /// <summary>
        /// 获取推送消息配置列表
        /// </summary>
        /// <param name="start">开始时间</param>
        /// <param name="end">结束时间</param>
        /// <param name="ascending">升序排序</param>
        /// <param name="pageIndex">当前页码</param>
        /// <param name="pageSize">每页数据条数</param>
        /// <returns></returns>
        Task<(IEnumerable<PushMessageConfigEntity>, int)> Query(DateTime? start, DateTime? end, bool? ascending, int pageIndex, int pageSize);

        /// <summary>
        /// 通过id获取消息配置
        /// </summary>
        /// <param name="pushMessageConfigId">消息配置id </param>
        /// <returns></returns>
        Task<PushMessageConfigEntity> GetById(int pushMessageConfigId);

        /// <summary>
        /// 添加推送消息配置
        /// </summary>
        /// <param name="pushMessageConfigEntity">推送消息配置</param>
        /// <returns></returns>
        Task<PushMessageConfigEntity> Add(PushMessageConfigEntity pushMessageConfigEntity);

        /// <summary>
        /// 修改推送消息配置
        /// </summary>
        /// <param name="pushMessageConfigEntity">推送消息配置</param>
        /// <returns></returns>
        Task<PushMessageConfigEntity> Update(PushMessageConfigEntity pushMessageConfigEntity);
    }
}